package com.itheima.d7_IO.FileWriter;

import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;

public class Test {
    public static void main(String[] args) throws Exception {
        Writer fileWriter = new FileWriter("E:\\FileResource\\2.txt");
        fileWriter.write("c");
        fileWriter.write(97);
        fileWriter.write('K');
        fileWriter.write("\r\n");
        String s = "移民";
        char[] chars = s.toCharArray();
        fileWriter.write(chars);
        fileWriter.write("直接一个字符串也能写");
        fileWriter.write("ddd我是",0,4);  //4表示写几个
        fileWriter.write(chars,0,1);
        fileWriter.close();
    }
}
